using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ImageAnalystTools._ChangeDetection
{
    /// <summary>
    /// <para>Compute Change Raster</para>
    /// <para>Calculates the absolute, relative, or categorical difference between two raster datasets.</para>
    /// <para>计算两个栅格数据集之间的绝对差值、相对差值或分类差值。</para>
    /// </summary>    
    [DisplayName("Compute Change Raster")]
    public class ComputeChangeRaster : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ComputeChangeRaster()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_from_raster">
        /// <para>From Raster</para>
        /// <para>The initial or earlier raster to be analyzed.</para>
        /// <para>要分析的初始栅格或更早栅格。</para>
        /// </param>
        /// <param name="_to_raster">
        /// <para>To Raster</para>
        /// <para>The final or later raster to be analyzed. This is the raster that will be compared to the initial raster.</para>
        /// <para>要分析的最终或更高版本栅格。这是将与初始栅格进行比较的栅格。</para>
        /// </param>
        /// <param name="_out_raster_dataset">
        /// <para>Output Raster</para>
        /// <para>The output change raster dataset.</para>
        /// <para>输出更改栅格数据集。</para>
        /// </param>
        public ComputeChangeRaster(object _from_raster, object _to_raster, object _out_raster_dataset)
        {
            this._from_raster = _from_raster;
            this._to_raster = _to_raster;
            this._out_raster_dataset = _out_raster_dataset;
        }
        public override string ToolboxName => "Image Analyst Tools";

        public override string ToolName => "Compute Change Raster";

        public override string CallName => "ia.ComputeChangeRaster";

        public override List<string> AcceptEnvironments => ["cellAlignment", "cellSize", "compression", "configKeyword", "extent", "geographicTransformations", "nodata", "outputCoordinateSystem", "parallelProcessingFactor", "pyramid", "rasterStatistics", "resamplingMethod", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_from_raster, _to_raster, _out_raster_dataset, _compute_change_method.GetGPValue(), _from_classes, _to_classes, _filter_method.GetGPValue(), _define_transition_colors.GetGPValue()];

        /// <summary>
        /// <para>From Raster</para>
        /// <para>The initial or earlier raster to be analyzed.</para>
        /// <para>要分析的初始栅格或更早栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("From Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _from_raster { get; set; }


        /// <summary>
        /// <para>To Raster</para>
        /// <para>The final or later raster to be analyzed. This is the raster that will be compared to the initial raster.</para>
        /// <para>要分析的最终或更高版本栅格。这是将与初始栅格进行比较的栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("To Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _to_raster { get; set; }


        /// <summary>
        /// <para>Output Raster</para>
        /// <para>The output change raster dataset.</para>
        /// <para>输出更改栅格数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster_dataset { get; set; }


        /// <summary>
        /// <para>Compute Change Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the type of calculation to perform between the two rasters.</para>
        ///   <bulletList>
        ///     <bullet_item>Difference—The mathematical difference, or subtraction, between the pixel values in the rasters will be calculated. This is the default.</bullet_item><para/>
        ///     <bullet_item>Relative difference—The difference in pixel values, accounting for the quantities of the values being compared, will be calculated.</bullet_item><para/>
        ///     <bullet_item>Categorical difference—The difference between two categorical or thematic rasters will be calculated in which the output contains class transitions that occurred between the two rasters.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要在两个栅格之间执行的计算类型。</para>
        ///   <bulletList>
        ///     <bullet_item>差值—将计算栅格中像素值之间的数学差值或减法。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>相对差值—将计算像素值的差值（考虑要比较的值的数量）。</bullet_item><para/>
        ///     <bullet_item>分类差异—将计算两个分类栅格或专题栅格之间的差值，其中输出包含两个栅格之间发生的类转换。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compute Change Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _compute_change_method_value _compute_change_method { get; set; } = _compute_change_method_value._DIFFERENCE;

        public enum _compute_change_method_value
        {
            /// <summary>
            /// <para>Difference</para>
            /// <para>Difference—The mathematical difference, or subtraction, between the pixel values in the rasters will be calculated. This is the default.</para>
            /// <para>差值—将计算栅格中像素值之间的数学差值或减法。这是默认设置。</para>
            /// </summary>
            [Description("Difference")]
            [GPEnumValue("DIFFERENCE")]
            _DIFFERENCE,

            /// <summary>
            /// <para>Relative difference</para>
            /// <para>Relative difference—The difference in pixel values, accounting for the quantities of the values being compared, will be calculated.</para>
            /// <para>相对差值—将计算像素值的差值（考虑要比较的值的数量）。</para>
            /// </summary>
            [Description("Relative difference")]
            [GPEnumValue("RELATIVE_DIFFERENCE")]
            _RELATIVE_DIFFERENCE,

            /// <summary>
            /// <para>Categorical difference</para>
            /// <para>Categorical difference—The difference between two categorical or thematic rasters will be calculated in which the output contains class transitions that occurred between the two rasters.</para>
            /// <para>分类差异—将计算两个分类栅格或专题栅格之间的差值，其中输出包含两个栅格之间发生的类转换。</para>
            /// </summary>
            [Description("Categorical difference")]
            [GPEnumValue("CATEGORICAL_DIFFERENCE")]
            _CATEGORICAL_DIFFERENCE,

        }

        /// <summary>
        /// <para>From Classes</para>
        /// <para><xdoc>
        ///   <para>The list of class names from the From Raster parameter to be included in the computation. If no classes are provided, all classes will be included.</para>
        ///   <para>This parameter is active when the Compute Change Method parameter is set to Categorical difference.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要包含在计算中的 From Raster 参数中的类名列表。如果没有提供课程，则将包括所有课程。</para>
        ///   <para>当“计算更改方法”参数设置为“分类差异”时，此参数处于活动状态。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("From Classes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _from_classes { get; set; } = null;


        /// <summary>
        /// <para>To Classes</para>
        /// <para><xdoc>
        ///   <para>The list of class names from the To Raster parameter to be included in the computation. If no classes are provided, all classes will be included.</para>
        ///   <para>This parameter is active when the Compute Change Method parameter is set to Categorical difference.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要包含在计算中的 To Raster 参数中的类名列表。如果没有提供课程，则将包括所有课程。</para>
        ///   <para>当“计算更改方法”参数设置为“分类差异”时，此参数处于活动状态。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("To Classes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _to_classes { get; set; } = null;


        /// <summary>
        /// <para>Filter Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the pixels to be categorized in the output raster. This parameter is active when the Compute Change Method parameter is set to Categorical difference.</para>
        ///   <bulletList>
        ///     <bullet_item>Changed pixels only—Only the pixels that changed categories will be categorized in the output. All pixels that did not change categories will be grouped in a class called Other.</bullet_item><para/>
        ///     <bullet_item>Unchanged pixels only—Only the pixels that did not change categories will be categorized in the output. All pixels that changed categories will be groups in a class called Other.</bullet_item><para/>
        ///     <bullet_item>All pixels—All pixels will be categorized in the output. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要在输出栅格中分类的像素。当“计算更改方法”参数设置为“分类差异”时，此参数处于活动状态。</para>
        ///   <bulletList>
        ///     <bullet_item>仅更改的像素 - 只有更改类别的像素才会在输出中分类。所有未更改类别的像素都将分组到名为“其他”的类中。</bullet_item><para/>
        ///     <bullet_item>仅未更改的像素 - 只有未更改类别的像素才会被归类到输出中。更改类别的所有像素都将是名为“其他”的类中的组。</bullet_item><para/>
        ///     <bullet_item>所有像素—所有像素都将在输出中分类。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Filter Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _filter_method_value _filter_method { get; set; } = _filter_method_value._CHANGED_PIXELS_ONLY;

        public enum _filter_method_value
        {
            /// <summary>
            /// <para>All pixels</para>
            /// <para>All pixels—All pixels will be categorized in the output. This is the default.</para>
            /// <para>所有像素—所有像素都将在输出中分类。这是默认设置。</para>
            /// </summary>
            [Description("All pixels")]
            [GPEnumValue("ALL")]
            _ALL,

            /// <summary>
            /// <para>Changed pixels only</para>
            /// <para>Changed pixels only—Only the pixels that changed categories will be categorized in the output. All pixels that did not change categories will be grouped in a class called Other.</para>
            /// <para>仅更改的像素 - 只有更改类别的像素才会在输出中分类。所有未更改类别的像素都将分组到名为“其他”的类中。</para>
            /// </summary>
            [Description("Changed pixels only")]
            [GPEnumValue("CHANGED_PIXELS_ONLY")]
            _CHANGED_PIXELS_ONLY,

            /// <summary>
            /// <para>Unchanged pixels only</para>
            /// <para>Unchanged pixels only—Only the pixels that did not change categories will be categorized in the output. All pixels that changed categories will be groups in a class called Other.</para>
            /// <para>仅未更改的像素 - 只有未更改类别的像素才会被归类到输出中。更改类别的所有像素都将是名为“其他”的类中的组。</para>
            /// </summary>
            [Description("Unchanged pixels only")]
            [GPEnumValue("UNCHANGED_PIXELS_ONLY")]
            _UNCHANGED_PIXELS_ONLY,

        }

        /// <summary>
        /// <para>Transition Class Colors</para>
        /// <para><xdoc>
        ///   <para>Specifies the color to use to symbolize the output classes. When a pixel changes from one class type to another, the output pixel color represents the initial class type, the final class type, or a blend of the two.</para>
        ///   <para>This parameter is active when the Compute Change Method parameter is set to Categorical difference.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于符号化输出类的颜色。当像素从一种类类型更改为另一种类类型时，输出像素颜色表示初始类类型、最终类类型或两者的混合。</para>
        ///   <para>当“计算更改方法”参数设置为“分类差异”时，此参数处于活动状态。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Transition Class Colors")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _define_transition_colors_value _define_transition_colors { get; set; } = _define_transition_colors_value._AVERAGE;

        public enum _define_transition_colors_value
        {
            /// <summary>
            /// <para>Average From and To colors</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Average From and To colors")]
            [GPEnumValue("AVERAGE")]
            _AVERAGE,

            /// <summary>
            /// <para>From color</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("From color")]
            [GPEnumValue("FROM_COLOR")]
            _FROM_COLOR,

            /// <summary>
            /// <para>To color</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("To color")]
            [GPEnumValue("TO_COLOR")]
            _TO_COLOR,

        }

        public ComputeChangeRaster SetEnv(object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object nodata = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object pyramid = null, object rasterStatistics = null, object resamplingMethod = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, nodata: nodata, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, pyramid: pyramid, rasterStatistics: rasterStatistics, resamplingMethod: resamplingMethod, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}